<#include "inc/layout.html">
<@layout title="首页" js="main.js">
<style>
	html {overflow:auto;}
	body {padding:5px;}
	.col-sm-6, .col-sm-4, .col-sm-7 {min-width:300px;padding:2px;}
	.col-sm-2 {padding:2px;}
	.panel {margin-bottom:5px;}
	.f48{font-size:48px;}
	.span3{width:200px;float:left;margin-left:10px;}
	.top-block {font-size:14px;text-align:center;padding:5px;font-weight:bold;position:relative;
	display:block;line-height:22px;text-shadow:0 0 1px #DDD;text-decoration:none;}
	.hello-right {float:left;margin-left:10px;}
	.hello-right h4 {font-size:16px;font-weight:bold;margin:4px 0 8px;display:inline-block;color:#323a45;word-break:break-all;line-height:150%;}
	.hello-right span {color:#8a959e;}
	.avatar{border-radius:50%;width:60px;height:60px;background:#f7f7f7;-webkit-box-shadow:0 0 1px #ddd;box-shadow:0 0 1px #ddd;}
</style>

<div ms-controller="mainCtrl">
	<p style="margin:5px;">
		每日一语：
<!-- 	<marquee> -->
		<font color="red">{{dailyPhrase.content}}</font>
<!-- 	</marquee> -->
	</p>
	
	<div class="panel panel-default">
		<div class="panel-body" style="padding-bottom:0px;">
			<div class="fl">
				<img class="avatar fl" ms-attr-src="user.head_pic" ms-attr-alt="user.realname" />
				<div class="hello-right">
					<h4 class="ng-binding">{{user.realname}}, 您好！</h4><br> 
					<span class="ng-binding">
						今天是 ${now?string('yyyy年MM月dd日')}
					<br>
						{{user.position_name}}-{{user.department_name}}
					</span>
				</div>
			</div>
			
			<div class="fr" ms-if="showByRights('A3_1_S')">
				<a data-rel="tooltip" title="" class="well span3 top-block">
					<i class="f48 fa fa-user fl"></i>
					<div>客户</div>
					<div title="总计客户数">{{mainInfo.cust_count}}</div>
					<span class="notification green" title="新增客户数">{{mainInfo.cust_newaddcount}}</span>
				</a>
				
				<a data-rel="tooltip" title="" class="well span3 top-block">
					<i class="f48 fa fa-money fl"></i>
					<div>应收款</div>
					<div title="总计应收款">
						<i class="fa fa-rmb"></i>{{mainInfo.payab_amt1|money}}
					</div>
					<span class="notification green" title="新增应收款">
						<i class="fa fa-rmb"></i>{{mainInfo.payab_newamt1|money}}
					</span>
				</a>
				
				<a data-rel="tooltip" title="" class="well span3 top-block">
					<i class="f48 fa fa-money fl"></i>
					<div>应付款</div>
					<div title="总计应付款">
						<i class="fa fa-rmb"></i>{{mainInfo.payab_amt|money}}
					</div>
					<span class="notification green" title="新增应付款">
						<i class="fa fa-rmb"></i>{{mainInfo.payab_newamt|money}}
					</span>
				</a>
				
				<a data-rel="tooltip" title="" class="well span3 top-block">
					<i class="f48 fa fa-shopping-cart fl"></i>
					<div>销售额</div>
					<div title="总计销售额">
						<i class="fa fa-rmb"></i>{{mainInfo.sale_amt|money}}
					</div>
					<span class="notification green" title="新增销售额">
						<i class="fa fa-rmb"></i>{{mainInfo.sale_newamt|money}}
					</span>
				</a>
				
				<a data-rel="tooltip" title="" class="well span3 top-block" ms-if="false">
					<i class="f48 fa fa-comments fl"></i>
					<div>消息</div>
					<div>25</div>
					<span class="notification red">12</span>
				</a>
				
			</div>
		</div>
	</div>
	
	<div class="panel panel-default" ms-if="showByRights('A3_1_S')">
		<div class="panel-body" style="padding-bottom:0px;height:100px;">
			<a title="设置我的销售目标" ms-click="mdfSaleGoal" style="position:absolute;right:20px;font-size: 24px;margin-top: -10px;">
				<i class="fa fa-cog"></i>
			</a>
			
			<table style="height:100%;width:100%;text-align:center;font-size:18px;">
				<tr>
					<td>本月成交金额</td>
					<td>本月回款金额</td>
					<td>本月目标金额</td>
					<td>本月完成率</td>
					<td>本月剩余</td>
				</tr>
				<tr>
					<td>
						<i class="fa fa-rmb"></i>&nbsp;{{mainInfo.deal_amt|money}}
					</td>
					<td>
						<i class="fa fa-rmb"></i>&nbsp;{{mainInfo.back_amt|money}}
					</td>
					<td>
						<i class="fa fa-rmb"></i>&nbsp;{{mainInfo.goal_amt|money}}
					</td>
					<td ms-if="mainInfo.goal_amt>0">
						{{fixedNum((mainInfo.deal_amt/mainInfo.goal_amt)*100,2)}}%
					</td>
					<td ms-if="mainInfo.goal_amt==0">--</td>
					<td>{{month_over}}天</td>
				</tr>
			</table>
		</div>
	</div>
	
	<div class="col-sm-6">
		<div class="panel panel-default h300">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-bell-o"></i>企业资讯
				</h3>
			</div>
			
			<div class="panel-body" ms-repeat="noticeList">
				<div>
					<div class="fl">
						<a>{{$index + 1}} - {{el.title}}</a>
					</div>
					
					<div class="fr">{{el.create_datetime}}</div>
				</div>
			</div>
		</div>
		
		<div class="panel panel-default h300" ms-if="showByRights('A3_1_S')">
			<div class="panel-body">
				<div id="salefunnel" style="widht:100%;height:300px;"></div>
			</div>
		</div>
	</div>
	
	<div class="col-sm-6">
		<div class="panel panel-default h300">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-calendar"></i>我的日程
				</h3>
			</div>
			
			<div class="panel-body" ms-repeat="noticeList">
				<div>
					<div class="fl">
						<a>{{$index + 1}} - {{el.title}}</a>
					</div>
					
					<div class="fr">{{el.create_datetime}}</div>
				</div>
			</div>
		</div>
		
		<div class="panel panel-default h300" ms-if="showByRights('A1_1_S')">
			<div class="panel-heading">
				<h3 class="panel-title">应收款</h3>
			</div>
			
			<div class="panel-body" ms-repeat="concatRecordList">
				<div>
					<div class="fl">
						<a>{{$index + 1}} - {{el.title}}</a>
					</div>
					
					<div class="fr">{{el.create_datetime}}</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 
	<div class="col-sm-2">
		<div class="panel panel-default h600">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-rocket"></i>快捷操作
				</h3>
			</div>
			<div class="panel-body">
				<p>
					<i class="fa fa-plus"></i>添加客户
				</p>
				<p>
					<i class="fa fa-plus"></i>添加客户
				</p>
				<p>
					<i class="fa fa-plus"></i>添加客户
				</p>
				<p>
					<i class="fa fa-plus"></i>添加客户
				</p>
				<p>
					<i class="fa fa-plus"></i>添加客户
				</p>
			</div>
		</div>
	</div> 
	
	<div class="col-sm-6">
		<div class="panel panel-default h300">
			<div class="panel-heading">
				<h3 class="panel-title"></h3>
			</div>
			<div class="panel-body"></div>
		</div>
	</div>
	
	<div class="col-sm-7">
		<div class="panel panel-default h300">
			<div class="panel-heading">
				<h3 class="panel-title"></h3>
			</div>
			<div class="panel-body"></div>
		</div>
	</div> 
	-->
</div>
</@layout>
